package com.mumu.studykotlin

import com.mumu.studykotlin.gra.User
import com.mumu.studykotlin.gra.inherit.Persion
import com.mumu.studykotlin.gra.inherit.Student
import com.mumu.studykotlin.gra.inherit.Teacher
import org.junit.Test

/**
 *edie create on 2019/7/25
 *
 */
class StudentTest {

    @Test
    fun _stuTest(){
        Student("王小明",18).say()
    }

    @Test
    fun _teaTest(){
        Teacher("老王","12").say()
    }

    /**扩展函数**/
    fun User.Print(){
        print("用户名 $name")
    }

    fun User.hh(){
        println("姓名: $name")
    }

    fun Persion.hh() {
        println("姓名: $name")
    }

    @Test
    fun main(){
        var user = User("Runoob")
        user.hh()
        user.Print()
        val copy = User("网二")
        val s = copy.toString()
        println(s)
    }

}